<?php
//漏洞管理模块路由
Route::group(['namespace'=>'Flaw'],function(){
    //漏洞菜单路由
    Route::get('cateIndex','CategoryController@index')->name('admin.flaw.index')->middleware('access.routeNeedsPermission:cate-index');
    Route::any('cateAdd','CategoryController@addCategory')->name('admin.flaw.add')->middleware('access.routeNeedsPermission:cate-add');
    Route::any('cateUpdate/id/{id?}','CategoryController@update')->name('admin.flaw.update')->middleware('access.routeNeedsPermission:cate-update');
    Route::get('cateDel/id/{id}','CategoryController@del')->name('admin.flaw.del')->middleware('access.routeNeedsPermission:cate-delete');
    //分类恢复、物理删除
    Route::get('CateRestore/id/{id}','CategoryController@restoreCate')->name('admin.flaw.caterestore')->middleware('access.routeNeedsPermission:cate-restore');
    Route::get('CateForceDel/id/{id}','CategoryController@forceDelCate')->name('admin.flaw.cateforcedel')->middleware('access.routeNeedsPermission:cate-forcedel');
    //等级评分路由
    Route::any('levelList','LevelController@levelList')->name('admin.flaw.levellist')->middleware('access.routeNeedsPermission:level-index');
    Route::any('levelAdd','LevelController@addLevel')->name('admin.flaw.leveladd')->middleware('access.routeNeedsPermission:level-add');
    Route::any('levelUpdate/id/{id?}','LevelController@updateLevel')->name('admin.flaw.levelupdate')->middleware('access.routeNeedsPermission:level-update');
    Route::get('levelDel/id/{id}','LevelController@delLevel')->name('admin.flaw.leveldel')->middleware('access.routeNeedsPermission:level-delete');
    //等级恢复、物理删除
    Route::get('levelRestore/id/{id}','LevelController@restoreLevel')->name('admin.flaw.levelrestore')->middleware('access.routeNeedsPermission:level-restore');
    Route::get('levelForceDel/id/{id}','LevelController@forceDelLevel')->name('admin.flaw.levelforcedel')->middleware('access.routeNeedsPermission:level-forcedel');
    //漏洞发布审核路由
    Route::get('vulsList','VulsController@vulsList')->name('admin.flaw.vulslist')->middleware('access.routeNeedsPermission:vuls-index');
    Route::any('vulsAdd','VulsController@addVuls')->name('admin.flaw.vulsadd')->middleware('access.routeNeedsPermission:vuls-add');
    Route::any('vulsUpdate/id/{id?}','VulsController@updateVuls')->name('admin.flaw.vulsupdate')->middleware('access.routeNeedsPermission:vuls-update');
    Route::get('vulsDel/id/{id}','VulsController@delVuls')->name('admin.flaw.vulsdel')->middleware('access.routeNeedsPermission:vuls-delete');
    //漏洞恢复、物理删除
    Route::get('vulsRestore/id/{id}','VulsController@restoreVuls')->name('admin.flaw.vulsrestore')->middleware('access.routeNeedsPermission:vuls-restore');
    Route::get('vulsForceDel/id/{id}','VulsController@forceDelVuls')->name('admin.flaw.vulsforcedel')->middleware('access.routeNeedsPermission:vuls-forcedel');
   //等级评分是否合理
    Route::post('sentencePointsVuls','VulsController@sentencePointsVuls')->name('admin.flaw.sentencepointsvuls')->middleware('access.routeNeedsPermission:vuls-sentencepoints');
    //重新编辑等级评分
    Route::post('vulsReedit','VulsController@vulsReedit')->name('admin.flaw.vulsreedit')->middleware('access.routeNeedsPermission:vuls-vulsreedit');
    //获取当前等级积分
    Route::get('getPointsAjax/id/{id}','VulsController@getPointsAjax')->middleware('access.routeNeedsPermission:vuls-sentencepoints');
    
    //详情
    Route::get('vulsDetail/id/{id?}','VulsController@updateVuls')->name('admin.flaw.vulsdetail')->middleware('access.routeNeedsPermission:vuls-detail');
    //初审
    Route::get('confirmShow/id/{id}/view/{view}','VulsController@confirmShow')->name('admin.flaw.confirmShow')->middleware('access.routeNeedsPermission:vuls-audit');
//    Route::get('confirmShow/id/{id}/view/check','VulsController@confirmShow')->name('admin.flaw.confirmShow')->middleware('access.routeNeedsPermission:vuls-checkForm');

    Route::get('check/id/{id}','VulsController@check')->name('admin.flaw.check')->middleware('access.routeNeedsPermission:vuls-checkForm'); //待审核
    Route::get('checked/id/{id}','VulsController@checked')->name('admin.flaw.checked')->middleware('access.routeNeedsPermission:vuls-checkedForm'); //已审核
    Route::get('ensure/id/{id}','VulsController@ensure')->name('admin.flaw.ensure')->middleware('access.routeNeedsPermission:vuls-ensureForm');    //待确认
    Route::get('repair/id/{id}','VulsController@repair')->name('admin.flaw.repair')->middleware('access.routeNeedsPermission:vuls-repairForm');//待修复
    Route::get('confirm/id/{id}','VulsController@confirm')->name('admin.flaw.confirm')->middleware('access.routeNeedsPermission:vuls-confirmForm;vuls-confirmView');//修复确认
    Route::get('solved/id/{id}','VulsController@solved')->name('admin.flaw.solved')->middleware('access.routeNeedsPermission:vuls-solvedForm');//已解决
    Route::get('shut/id/{id}','VulsController@shut')->name('admin.flaw.shut')->middleware('access.routeNeedsPermission:vuls-shutDownForm');//已关闭
    Route::get('ignore/id/{id}','VulsController@ignore')->name('admin.flaw.ignore')->middleware('access.routeNeedsPermission:vuls-ignoreForm');//已关闭
    Route::get('noEffect/id/{id}','VulsController@noEffect')->name('admin.flaw.noEffect')->middleware('access.routeNeedsPermission:vuls-ignoreForm');//已关闭
    Route::get('appeal/id/{id}','VulsController@appeal')->name('admin.flaw.appeal')->middleware('access.routeNeedsPermission:vuls-appealForm;vuls-appealFormView');//申诉中
//    Route::get('appeal/id/{id}','VulsController@appeal')->name('admin.flaw.appeal')->middleware('access.routeNeedsPermission:vuls-appealFormView');//申诉中
    // Route::any('vulsAudit/id/{id?}','VulsController@auditVuls')->name('admin.flaw.vulsaudit');
    //状态流确认
    Route::post('ajax','VulsController@ajaxForm')->name('vuls.ajax')->middleware('access.routeNeedsPermission:vuls-checkForm');//请求金币以及积分;
    Route::group(['middleware' => ['operatevuls']], function(){
        Route::post('ensureForm','VulsController@ensureForm')->name('admin.flaw.ensureForm');
        Route::post('repairForm','VulsController@repairForm')->name('admin.flaw.repairForm');
        Route::post('shutDownForm','VulsController@shutDownForm')->name('admin.flaw.shutDownForm');
        Route::post('appealForm','VulsController@appealForm')->name('admin.flaw.appealForm');
        Route::post('checkForm','VulsController@checkForm')->name('admin.flaw.checkForm');
        Route::post('checkedForm','VulsController@checkedForm')->name('admin.flaw.checkedForm');
        Route::post('confirmForm','VulsController@confirmForm')->name('admin.flaw.confirmForm');

    });


    //搜索、导出、等附加操作相关路由
    Route::any('vulsSearch/searchStatus/{searchStatus?}','AdditionController@search')->name('admin.flaw.search')->middleware('access.routeNeedsPermission:vuls-index');
    Route::get('searchAjax/type/{type}/id/{id}','AdditionController@searchAjax');
    Route::get('appajaxreturn/id/{id}','AdditionController@appAjaxReturn');
    Route::get('exportVuls','AdditionController@exportVuls')->name('admin.flaw.export')->middleware('access.routeNeedsPermission:addition-export');


    //漏洞分发
    Route::any('ajaxVuls','VulsController@ajaxVuls')->name('admin.flaw.vuls_id')->middleware('access.routeNeedsPermission:distribute-distribute');
    Route::any('distribute','VulsController@distribute')->name('admin.flaw.distribute')->middleware('access.routeNeedsPermission:distribute-distribute');
    Route::any('distridel','VulsController@distridel')->name('admin.flaw.distridel')->middleware('access.routeNeedsPermission:distribute-distribute');
    Route::any('getusers','VulsController@getUsers')->name('admin.flaw.getusers')->middleware('access.routeNeedsPermission:distribute-distribute');
    //申请延时
    Route::any('applydelay','VulsController@delay')->name('admin.flaw.delay')->middleware('access.routeNeedsPermission:vuls-delay');
    Route::any('getonedelay','VulsController@getOneDelay')->name('admin.flaw.getonedelay')->middleware('access.routeNeedsPermission:vuls-delay;vuls-auditdelay');
    Route::any('auditdelay','VulsController@auditDelay')->name('admin.flaw.auditdelay')->middleware('access.routeNeedsPermission:vuls-auditdelay');
    Route::any('applypage','VulsController@applyPage')->name('admin.flaw.applypage')->middleware('access.routeNeedsPermission:vuls-delay;vuls-auditdelay');
});